﻿@model PaymentHelper.Core.Order
@using PaymentHelper.PaymentFlowTemplates.Default.Models;           

@{
    ViewBag.Title = ViewBag.Resources["DefaultPaymentFlow.ConfirmTitle"];

    if (!string.IsNullOrEmpty(PaymentHelper.PaymentFlow.PaymentFlowManager.Layout))
    {
        Layout = PaymentHelper.PaymentFlow.PaymentFlowManager.Layout;
    }
}


<div class="@ViewBag.CssClass">
    
    @Html.Action("PaymentSteps","DefaultTemplate", new { step = PaymentStep.Confirm })

    @using (Html.BeginForm("DoPayment", "DefaultTemplate", FormMethod.Post))
    {
        <div class="payment_content ph_review_order">
            <fieldset>
                <legend>@ViewBag.Resources["DefaultPaymentFlow.OrderInfo"]</legend>
                <table>
                    <thead>
                        <tr><td colspan="2">@ViewBag.Resources["DefaultPaymentFlow.Buyer"]</td></tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.FullName"]
                            </td>
                            <td class="value">
                                @(Model.BillingAddress.FirstName + " " + Model.BillingAddress.LastName) 
                            </td>
                        </tr>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.Fone"]
                            </td>
                            <td class="value">
                                @(Model.BillingAddress.PhoneNumber) 
                            </td>
                        </tr>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.Email"]
                            </td>
                            <td class="value">
                                @(Model.BillingAddress.Email) 
                            </td>
                        </tr>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.Address"]
                            </td>
                            <td class="value">
                                @(Model.BillingAddress.GetFullAdress()) 
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table>
                    <thead>
                        <tr><td colspan="2">@ViewBag.Resources["DefaultPaymentFlow.ShippingAddress"]</td></tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.FullName"]
                            </td>
                            <td class="value">
                                @(Model.ShippingAddress.FirstName + " " + Model.ShippingAddress.LastName) 
                            </td>
                        </tr>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.Fone"]
                            </td>
                            <td class="value">
                                @(Model.ShippingAddress.PhoneNumber) 
                            </td>
                        </tr>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.Email"]
                            </td>
                            <td class="value">
                                @(Model.ShippingAddress.Email) 
                            </td>
                        </tr>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.Address"]
                            </td>
                            <td class="value">
                                @(Model.ShippingAddress.GetFullAdress(true)) 
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table class="order_fee">
                    <thead>
                        <tr>
                            <td colspan="2">@ViewBag.Resources["DefaultPaymentFlow.OrderValue"]
                            </td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.CartTotal"]
                            </td>
                            <td class="value">
                                @Model.CartTotal
                            </td>
                        </tr>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.ShippingFee"]
                            </td>
                            <td class="value">
                                @Model.ShippingFee
                            </td>
                        </tr>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.TaxFee"]
                            </td>
                            <td class="value">
                                @Model.TaxFee
                            </td>
                        </tr>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.HandlingFee"]
                            </td>
                            <td class="value">
                                @Model.HandlingFee
                            </td>
                        </tr>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.OtherFee"]
                            </td>
                            <td class="value">
                                @Model.OtherFee
                            </td>
                        </tr>
                        <tr>
                            <td class="label">
                                @ViewBag.Resources["DefaultPaymentFlow.OrderTotal"]
                            </td>
                            <td class="value">
                                <strong style="color: Red; font-size: 15px;">@Model.OrderTotal </strong>(@Model.CustomerCurrency)
                            </td>
                        </tr>
                    </tbody>
                </table>
            </fieldset>

            @if (ViewBag.ShowCart)
            {
                @Html.Action("ShowCart", "DefaultTemplate");
            }

        </div>   
        
        <div class="btn_control">
            <p style="text-align: center;">
                <input type="button" value="@ViewBag.Resources["DefaultPaymentFlow.Cancle"]" onclick="location.href='@Url.RouteUrl("DefaultTemplate.Cancle")'" class="btn_ph_payment"/>
                <input type="submit" value="@ViewBag.Resources["DefaultPaymentFlow.Complete"]" class="btn_ph_payment" />
            </p>
        </div>
    }
</div>
